﻿<template>
  <div>
    <el-row>
      <el-col>
        <table-menu-item
          :items="tableStore.tableKindList"
          @select="handleSelect"
        />
      </el-col>
    </el-row>
  </div>
</template>

<script setup lang>
import { defineEmits, ref } from "vue";

import TableMenuItem from "./TableMenuItem.vue";
import usePsyTableStore from "../../../../store/psy/psyTable";

const tableStore = usePsyTableStore();

const emits = defineEmits(["updateData"]);

const handleSelect = () => {
  console.log('改变了！重新获取一下值');
  const currentTableList = tableStore.currentTableList;
  const tableKindText = tableStore.tableKindText;
  const tableData = ref({
    text: tableKindText,
    table: currentTableList,
  });
  emits("updateData", tableData);
};

</script>

<style scoped></style>
